package dataImport.model;

import dataImport.model.abstracts.AbstractEntity;


public class EmoteBeforeAction extends AbstractEntity {

	private static final long serialVersionUID = -8890333607190833910L;

	private CustomAction customAction;

	private String text;

	public EmoteBeforeAction(final CustomAction customAction, final String text) {
		super(createId(customAction.getId(), text));
		this.customAction = customAction;
		this.text = text;
	}

	public CustomAction getCustomAction() {
		return this.customAction;
	}

	public void setCustomAction(CustomAction customAction) {
		this.customAction = customAction;
	}

	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((this.customAction == null) ? 0 : this.customAction.hashCode());
		result = prime * result + ((this.text == null) ? 0 : this.text.hashCode());
		return result;
	}

	@Override
	public boolean equals(java.lang.Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		EmoteBeforeAction other = (EmoteBeforeAction) obj;
		if (this.customAction == null) {
			if (other.customAction != null) {
				return false;
			}
		}
		else if (!this.customAction.equals(other.customAction)) {
			return false;
		}
		if (this.text == null) {
			if (other.text != null) {
				return false;
			}
		}
		else if (!this.text.equals(other.text)) {
			return false;
		}
		return true;
	}

}
